package com.mwy.springbootrabbitmq.amqp;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

//监听指定队列
@RabbitListener(queues = "topic")
@Component
public class Receiver {

    //获取到消息之后的处理方法
    @RabbitHandler
    public void test(String message){
        System.out.println("消费者接收到消息："+message);
    }

}
